package book;

import java.util.Arrays;

public class Booklist {
    private Book[] books = new Book[100];


    public Booklist() {
        books[0] = new Book("追风筝的人",19,"卡勒德·胡塞尼");
        books[1] = new Book("哈利·波特",59,"JK·罗琳");
        books[2] = new Book("雨季不再来",33,"三毛");
        num = 3;
    }

    @Override
    public String toString() {
        return "Booklist{" +
                "books=" + Arrays.toString(books) +
                ", 总图书量=" + num +
                '}';
    }

    private int num;

    public int getNum() {
        return num;
    }

    public void setNum(int num) {
        this.num = num;
    }

    public Book getBook (int i) {
        return books[i];
    }
    public void setBook (int i, Book book) {
        books[i] = book;
    }
}
